LayerZ Schema and Types
This repository contains the schema and types used in the LayerZ project. It provides type definitions and validation schemas for various entities used throughout the LayerZ API.
Table of Contents
Installation
To install the package, use npm:
npm install lz-schema
Usage
Here's an example of how to use the schemas and types in your project:
import { createCampaignSchema, CreateCampaignBody } from 'lz-schema';
const campaignData: CreateCampaignBody = {
name: 'Summer Sale',
from: (new Date('2025-06-01')).getTime(),
to: (new Date('2025-06-30')).getTime(),
priority: 1,
workspaceId: '673517701433191f766ebfa4'
};
const validationResult = createCampaignSchema.safeParse(campaignData);
if (!validationResult.success) {
console.error('Validation failed:', validationResult.error);
} else {
console.log('Validation succeeded:', validationResult.data);
}
License
This project is licensed under the MIT License. See the LICENSE file for details.